/**
 *  Copyright 2009-2014 by WWW.KNET.CN  All rights reserved.
 */
package com.domain.model;

/**
 * TODO(这里用一句话描述这个类的作用)
 * 
 * @author liujie
 * @date 2015年4月28日 上午11:31:11
 * 
 */
public class Page {
	private int page = 1; // 当前页
	private int pageSize = 20; // 每页显示条数
	private int currentPage; // 当前页
	private int totalPage; // 总页数
	private int totalRow; // 总条数

	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public int getPageSize() {
		return pageSize;
	}

	public Page() {
		super();
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}

	public Page(int page, int pageSize, int totalRow) {
		super();
		this.page = page;
		this.pageSize = pageSize;
		this.totalRow = totalRow;
	}

	public int getTotalPage() {
		totalPage = (totalRow % pageSize) > 0 ? (totalRow / pageSize) + 1 : totalRow / pageSize;
		return totalPage;
	}

	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}

	public int getTotalRow() {
		return totalRow;
	}

	public void setTotalRow(int totalRow) {
		this.totalRow = totalRow;
	}
    public static void main(String[] args) {
		Page page= null;
		System.out.println(page.getPage());
		System.out.println(page.getPageSize());
		
	}
}
